package com.iyundao.io.Service.Impl;

import com.iyundao.io.Service.SysUserService;
import com.iyundao.io.mapper.SysUserMapper;
import com.iyundao.io.mapper.SysUserSqlMapper;
import com.iyundao.io.model.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.UUID;

/**
 * Created by black on 2019/3/20.
 */
@Service
@Transactional
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    SysUserMapper sysUserMapper;

    @Override
    public SysUser addSysUser(SysUser record) {
        record.setSid(UUID.randomUUID().toString());
        if(sysUserMapper.insertSelective(record) > 0){
            return sysUserMapper.selectByPrimaryKey(record.getSid());
        }else{
            return new SysUser();
        }
    }
}
